<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminConfigsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        /**
         * 系统配置表
         */
        Schema::create('admin_configs', function (Blueprint $table) {
            $table->increments('id');
            $table->tinyInteger('site_id', false, true)->default(0)->comment('站点编号 默认 0:表示公共配置; 大于0:站点配置');
            $table->char('name', 30)->comment('调用标识名')->unique();
            $table->tinyInteger('type', false, true)->default(0)->comment('配置类型');
            $table->string('title')->nullable()->comment('配置展示名称');
            $table->tinyInteger('group', false, true)->default(0)->comment('配置分组');
            $table->string('remark')->nullable()->comment('配置说明');
            $table->tinyInteger('is_developer', false, true)->default(0)->comment('是否是开发者可编辑');
            $table->text('extra')->nullable()->comment('扩展字段');
            $table->text('value')->nullable()->comment('配置值');
            $table->tinyInteger('sort', false, true)->default(0)->comment('排序');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('admin_configs');
    }
}
